/*
day342 
2020.8.4 
*/
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;

class Solution {
public:
    int partitionDisjoint(vector<int>& A) {
		int *max_l=new int[A.size()];
		int *min_r=new int[A.size()];
		
		max_l[0]=A[0];
		for(int i=1;i<A.size();++i)
		{
			max_l[i]=max(A[i],max_l[i-1]);
		}
		
		min_r[A.size()-1]=A.back();
		for(int i=A.size()-2;i>=0;--i)
		{
			min_r[i]=min(min_r[i+1],A[i]);
		}
		
		for(int i=0;i<A.size();++i)
		{
			if(max_l[i]<=min_r[i+1])
			{
				return i+1;
			}
		}
		
		return A.size();
    }
};

int main()
{
	return 0;
}
